<html xmlns:set="http://exslt.org/sets">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Getting Started</title>
<link rel="previous" href="getting-started.html" title="Getting Started">
<link rel="next" href="learning-sympy.html" title="Learning SymPy">
<link rel="top" href="guide.html" title="SymPy User's Guide">
<style type="text/css">

html { height: 100%; }
body {
  margin: 0px; padding: 12px;
  background-color: #f9f9f6;
  min-height: 100%;
  direction: ltr;
}
div, p, pre, blockquote { margin: 0; padding: 0; }
p img { vertical-align: middle; }
sub { font-size: 0.83em; }
sub sub { font-size: 1em; }
sup { font-size: 0.83em; }
sup sup { font-size: 1em; }
table { border-collapse: collapse; }
table.table-pgwide { width: 100%; }
td { vertical-align: top; }
td { padding: 0.2em 0.83em 0.2em 0.83em; }
th { padding: 0 0.83em 0 0.83em; }
tr.tr-shade {
  background-color: #f9f9f6;
}
td.td-colsep { border-right: solid 1px; }
td.td-rowsep { border-bottom: solid 1px; }
thead { border-top: solid 2px; border-bottom: solid 2px; }
tfoot { border-top: solid 2px; border-bottom: solid 2px; }
div.body {
  padding: 1em;
  max-width: 60em;
  background-color: #ffffff;
  border: solid 1px #e0e0df;
}
div.body-sidebar {
  
  margin-right: 13em;
}
div.division div.division { margin-top: 1.72em; }
div.division div.division div.division { margin-top: 1.44em; }
div.header {
  margin: 0;
  color: #3f3f3f;
  border-bottom: solid 1px #e0e0df;
}
h1, h2, h3, h4, h5, h6, h7 {
  margin: 0; padding: 0;
  color: #3f3f3f;
}
h1.title { font-size: 1.72em; }
h2.title { font-size: 1.44em; }
h3.title { font-size: 1.2em; }
h4.title, h5.title, h6.title, h7.title { font-size: 1em; }
.block { margin-top: 1em; }
.block .block-first { margin-top: 0; }
.block-indent {
  
  margin-left: 1.72em;
  
  margin-right: 1em;
}
.block-indent .block-indent { margin-left: 0em; margin-right: 0em; }
td .block-indent  { margin-left: 0em; margin-right: 0em; }
dd .block-indent  { margin-left: 0em; margin-right: 0em; }
.block-verbatim { white-space: pre; }
div.title {
  margin-bottom: 0.2em;
  font-weight: bold;
  color: #3f3f3f;
}
div.title-formal { padding-left: 0.2em; padding-right: 0.2em; }
div.title-formal .label { font-weight: normal; }
a {
  color: #1f609f;
  text-decoration: none;
}
a:hover { text-decoration: underline; }
a:visited { color: #9f1f6f; }
ul, ol, dl { margin: 0; padding: 0; }
li {
  margin-top: 1em;
  
  margin-left: 2.4em;
  
  padding: 0;
}
li.li-first { margin-top: 0; }
dt { margin: 1em 0 0 0; }
dt.dt-first { margin: 0; }
dd {
  
  margin-left: 1.72em;
  margin-top: 0.5em;
}
dl.dl-compact dt { margin-top: 0; }
dl.dl-compact dd { margin-top: 0; margin-bottom: 0; }


ul.linktrail {
  display: block;
  margin: 0.2em 0 0 0;
  
  text-align: right;
}
li.linktrail { display: inline; margin: 0; padding: 0; }

li.linktrail::before {
  content: '  /  ';
  color: #3f3f3f;
}

li.linktrail-first::before, li.linktrail-only::before { content: ''; }


div.navbar {
  padding: 0.5em 1em 0.5em 1em;
  max-width: 60em;
  background-color: #ffffff;
  border: solid 1px #e0e0df;
}
div.navbar-top { margin-bottom: 1em; }
div.navbar-bottom { margin-top: 1em; clear: both; }
div.navbar img { border: 0; vertical-align: -0.4em; }
table.navbar { width: 100%; margin: 0; border: none; }
table.navbar td { padding: 0; border: none; }
td.navbar-next {
  
  text-align: right;
}
a.navbar-prev::before {
  
  content: '◀  ';
  color: #3f3f3f;
}
a.navbar-next::after {
  
  content: '  ▶';
  color: #3f3f3f;
}


div.sidebar {
  
  float: right;
  padding: 0; margin: 0; width: 12em;
}
div.sidenav {
  padding: 0.5em 1em 0 1em;
  background-color: #ffffff;
  border: solid 1px #e0e0df;
}
div.sidenav div.autotoc {
  background-color: #ffffff;
  border: none; padding: 0; margin: 0;
}
div.sidenav div.autotoc div.autotoc { margin-top: 0.5em; }
div.sidenav div.autotoc li { margin-bottom: 0.5em; }
div.sidenav div.autotoc div.autotoc div.autotoc {
  
  margin-left: 1em;
  margin-top: 0;
}
div.sidenav div.autotoc div.autotoc div.autotoc li { margin-bottom: 0; }


div.autotoc {
  
  display: table;
  margin-top: 1em;
  
  margin-left: 1.72em;
  padding: 0.5em 1em 0.5em 1em;
  background-color: #f0f9ff;
  border: solid 1px #c0c9ff;
}
div.autotoc ul { margin: 0; padding: 0; }
div.autotoc li { list-style-type: none; margin: 0; }
div.autotoc div.autotoc-title { margin-bottom: 0.5em; }
div.autotoc div.autotoc { border: none; padding: 0; margin-top: 0; margin-bottom: 0.5em; }
div.autotoc div.autotoc div.autotoc { margin-bottom: 0; }


span.bibliolabel {
  color: #3f3f3f;
}


div.admonition {
  padding: 0.5em 1em 0.5em 1em;
  
  padding-left: 60px;
  min-height: 48px;
  border: solid 1px #e0e0df;
  background-color: #fffff0;
  
  background-position: 6px 0.5em;
  background-repeat: no-repeat;
}
div.caution {
  background-image: url("admon-caution.png");
}
div.important {
  background-image: url("admon-important.png");
}
div.note {
  background-image: url("admon-note.png");
}
div.note-bug {
  background-image: url("admon-bug.png");
}
div.tip {
  background-image: url("admon-tip.png");
}
div.warning {
  background-image: url("admon-warning.png");
}
div.blockquote {
  
  background-image: url('../../../data/icons/yelp-watermark-blockquote-201C.png');
  background-repeat: no-repeat;
  
  background-position: top left;
  padding: 0.5em;
  
  padding-left: 4em;
}
div.attribution {
  margin-top: 0.5em;
  color: #3f3f3f;
}
div.attribution::before {
  
  content: '― ';
}
div.epigraph {
  
  text-align: right;
  
  margin-left: 20%;
  
  margin-right: 0;
  color: #3f3f3f;
}
div.figure, div.informalfigure {
  
  display: table;
  padding: 0.5em;
  background-color: #f9f9f6;
  border: solid 1px #e0e0df;
}
div.figure-inner, div.informalfigure-inner {
  padding: 0.5em;
  background-color: #ffffff;
  border: solid 1px #e0e0df;
}
div.caption { margin-top: 0.5em; }
div.programlisting {
  padding: 0.5em;
  
  background-color: #f9f9f6;
  border: solid 1px #e0e0df;
}
div.screen {
  padding: 0.5em;
  
  background-color: #f9f9f6;
  border: solid 1px #e0e0df;
}
div.screen .prompt {
  color: #3f3f3f;
}
div.screen .userinput {
  font-weight: bold;
  color: #3f3f3f;
}
pre.linenumbering {
  color: #3f3f3f;
  margin: 0;
  
  padding-right: 1em;
  
  float: left;
  
  text-align: right;
}



dl.index dt { margin-top: 0; }
dl.index dd { margin-top: 0; margin-bottom: 0; }
dl.indexdiv dt { margin-top: 0; }
dl.indexdiv dd { margin-top: 0; margin-bottom: 0; }
dl.setindex dt { margin-top: 0; }
dl.setindex dd { margin-top: 0; margin-bottom: 0; }
div.list div.title-formal span.title {
  border-bottom: solid 1px #e0e0df;
}
div.simplelist {
  
  margin-left: 1.72em;
}
div.simplelist table { margin-left: 0; border: none; }
div.simplelist td {
  padding: 0.5em;
  border-left: solid 1px #e0e0df;
}
div.simplelist td.td-first {
  
  padding-left: 0;
  
  border-left: 0;
}
div.synopsis {
  padding: 0.5em;
  
  background-color: #f9f9f6;
  border-top: solid 2px #c0c9ff;
  border-bottom: solid 2px #c0c9ff;
}
div.synopsis div.synopsis {
  padding: 0;
  border: none;
}
div.synopsis div.block { margin-top: 0.2em; }
div.synopsis div.block-first { margin-top: 0; }


span.accel { text-decoration: underline; }
span.acronym { font-family: sans-serif; }
span.application { font-style: italic; }
span.classname, span.exceptionname, span.interfacename { font-family: monospace; }
span.code {
  font-family: monospace;
  border: solid 1px #e0e0df;
  
  padding-left: 0.2em;
  padding-right: 0.2em;
}
pre span.code { border: none; padding: 0; }
span.command {
  font-family: monospace;
  border: solid 1px #e0e0df;
  
  padding-left: 0.2em;
  padding-right: 0.2em;
}
pre span.command { border: none; padding: 0; }
span.computeroutput { font-family: monospace; }

span.constant { font-family: monospace; }
span.database { font-family: monospace; }
span.email { font-family: monospace; }
span.emphasis { font-style: italic; }
span.emphasis-bold { font-style: normal; font-weight: bold; }
span.envar { font-family: monospace; }

span.filename { font-family: monospace; }
span.firstterm { font-style: italic; }
span.foreignphrase { font-style: italic; }
span.function { font-family: monospace; }

dt.glossterm span.glossterm { font-style: normal; }


span.glossterm { font-style: italic; }

span.guibutton, span.guilabel, span.guimenu, span.guimenuitem, span.guisubmenu, span.interface {
  font-weight: bold;
  color: #3f3f3f;
}
span.keycap {
  font-weight: bold;
  color: #3f3f3f;
}
span.lineannotation { font-style: italic; }
span.literal { font-family: monospace; }
span.markup  { font-family: monospace; }
span.medialabel { font-style: italic; }
span.methodname { font-family: monospace; }
span.ooclass, span.ooexception, span.oointerface { font-family: monospace; }
span.option { font-family: monospace; }
span.parameter { font-family: monospace; }
span.paramdef span.parameter { font-style: italic; }
span.prompt { font-family: monospace; }
span.property { font-family: monospace; }
span.replaceable  { font-style: italic; }
span.returnvalue { font-family: monospace; }
span.sgmltag { font-family: monospace; }
span.structfield, span.structname { font-family: monospace; }
span.symbol { font-family: monospace; }
span.systemitem { font-family: monospace; }
span.token { font-family: monospace; }
span.type { font-family: monospace; }
span.uri { font-family: monospace; }
span.userinput { font-family: monospace; }
span.varname { font-family: monospace; }
span.wordasword { font-style: italic; }



div.footnotes { font-style: italic; font-size: 0.8em; }
div.footnote { margin-top: 1.44em; }
span.footnote-number { display: inline; padding-right: 0.83em; }
span.footnote-number + p { display: inline; }
a.footnote { text-decoration: none; font-size: 0.8em; }
a.footnote-ref { text-decoration: none; }

span.co {
  margin-left: 0.2em; margin-right: 0.2em;
  padding-left: 0.4em; padding-right: 0.4em;
  border: solid 1px #000000;
  -moz-border-radius: 8px;
  background-color: #000000;
  color: #FFFFFF;
  font-size: 8px;
}
span.co:hover {
  border-color: #333333;
  background-color: #333333;
  color: #FFFFFF;
}
span.co a { text-decoration: none; }
span.co a:hover { text-decoration: none; }

div.cmdsynopsis { font-family: monospace; }

dt.question { margin-left: 0em; }
dt.question div.label { float: left; }
dd + dt.question { margin-top: 1em; }
dd.answer {
  margin-top: 1em;
  margin-left: 2em;
  margin-right: 1em;
}
dd.answer div.label { float: left; }
</style>
</head>
<body>
<div class="navbar navbar-top"><table class="navbar"><tr>
<td class="navbar-prev"><a class="navbar-prev" href="getting-started.html" title="Getting Started">Getting Started</a></td>
<td class="navbar-next"><a class="navbar-next" href="learning-sympy.html" title="Learning SymPy">Learning SymPy</a></td>
</tr></table></div>
<div class="sidebar"><div class="sidenav"><div class="autotoc"><ul>
<li><a href="guide-info.html" title="About This Document">About This Document</a></li>
<li>
<a class="xref" href="guide.html" title="SymPy User's Guide">SymPy User's Guide</a><div class="autotoc"><ul>
<li>Getting Started</li>
<li><a class="xref" href="learning-sympy.html" title="Learning SymPy">Learning SymPy</a></li>
<li><a class="xref" href="contributing.html" title="Contributing">Contributing</a></li>
<li><a class="xref" href="about.html" title="About SymPy">About <span class="application">SymPy</span></a></li>
</ul></div>
</li>
</ul></div></div></div>
<div class="body body-sidebar"><div class="division sect1">
<a name="getting-started"></a><div class="header"><h1 class="sect1 title"><span class="title">Getting Started</span></h1></div>
<ul class="linktrail"><li class="linktrail linktrail-only"><a class="linktrail" href="guide.html" title="SymPy User's Guide">SymPy User's Guide</a></li></ul>
<div class="autotoc"><ul>
<li>
<span class="label">1.1. </span><a class="xref" href="getting-started.html" title="Introduction">Introduction</a>
</li>
<li>
<span class="label">1.2. </span><a class="xref" href="getting-started.html" title="First Steps with SymPy">First Steps with SymPy</a>
</li>
<li>
<span class="label">1.3. </span><a class="xref" href="getting-started.html" title="isympy Console"><span class="command">isympy</span> Console</a>
</li>
</ul></div>
<div class="division sect2">
<div class="header"><h2 class="sect2 title"><span class="title"><span class="label">1.1. </span>Introduction</span></h2></div>
<p class="para block block-first">
	  <span class="application">SymPy</span> is a Python library for symbolic mathematics. It aims to become a
      full-featured computer algebra system (CAS) while keeping the code as
      simple as possible in order to be comprehensible and easily extensible.
      <span class="application">SymPy</span> is written entirely in Python and does not require any external
      libraries.
   </p>
</div>
<div class="division sect2">
<div class="header"><h2 class="sect2 title"><span class="title"><span class="label">1.2. </span>First Steps with SymPy</span></h2></div>
<p class="para block block-first">
            The easiest way to download it is to go to <a class="ulink" href="http://code.google.com/p/sympy/" title="http://code.google.com/p/sympy/">http://code.google.com/p/sympy/</a> and
        download the latest tarball from the Featured Downloads section (<a class="xref" href="getting-started.html#tarball-download" title="Download part of the SymPy's webpage">Figure 1</a>).
        </p>
<div class=" block figure block-indent">
<a name="tarball-download"></a><div class="block block-first title title-formal"><span class="title"><span class="label"><span style="font-style: italic; ">Figure 1</span> </span>Download part of the SymPy's webpage</span></div>
<div class="figure-inner">
	  
	  <div class=" block screenshot block-first">
		<div class="mediaobject"><img src="figures/featured-downloads.png"></div>
	  </div>
	</div>
</div>
<p class="para block">
        Unpack it:
    </p>
<div class=" block screen block-indent"><pre class="screen"><span class="prompt">$</span> <span class="userinput">tar xzf sympy-0.5.12.tar.gz</span></pre></div>
<p class="para block">
    and try it from a Python intepreter:
    </p>
<div class=" block screen block-indent"><pre class="screen"><span class="prompt">$</span> <span class="userinput">cd sympy-0.5.12</span>
<span class="prompt">$</span> <span class="userinput">python</span>
Python 2.4.4 (#2, Jan  3 2008, 13:36:28) 
[GCC 4.2.3 20071123 (prerelease) (Debian 4.2.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
<span class="prompt">&gt;&gt;&gt;</span> <span class="userinput">from sympy import Symbol, cos</span>
<span class="prompt">&gt;&gt;&gt;</span> <span class="userinput">x = Symbol("x")</span>
<span class="prompt">&gt;&gt;&gt;</span> <span class="userinput">(1/cos(x)).series(x, 0, 10)</span>
1 + (1/2)*x**2 + (5/24)*x**4 + (61/720)*x**6 + (277/8064)*x**8 + O(x**10)</pre></div>
<p class="para block">
          You can use <span class="application">SymPy</span> as shown above and this is indeed
          the recommended way if you use it in your program. You can also
          install it using <span class="command">./setup.py install</span> as any other
          Python module, or just install a package in your favourite Linux
          distribution (see e.g. <a class="xref" href="getting-started.html#install-debian" title="Installing SymPy in Debian">Figure 2</a>).
      </p>
<div class=" block figure block-indent">
<a name="install-debian"></a><div class="block block-first title title-formal"><span class="title"><span class="label"><span style="font-style: italic; ">Figure 2</span> </span>Installing SymPy in Debian</span></div>
<div class="figure-inner">
	  
      <div class=" block screen block-indent block-first"><pre class="screen"><span class="prompt">$</span> <span class="userinput">sudo apt-get install python-sympy</span>
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  python-sympy
0 upgraded, 1 newly installed, 0 to remove and 18 not upgraded.
Need to get 991kB of archives.
After this operation, 5976kB of additional disk space will be used.
Get:1 http://ftp.cz.debian.org unstable/main python-sympy 0.5.12-1 [991kB]
Fetched 991kB in 2s (361kB/s)        
Selecting previously deselected package python-sympy.
(Reading database ... 232619 files and directories currently installed.)
Unpacking python-sympy (from .../python-sympy_0.5.12-1_all.deb) ...
Setting up python-sympy (0.5.12-1) ...</pre></div>
	</div>
</div>
<p class="para block">
    For other means how to install <span class="application">SymPy</span>, consult the <a class="ulink" href="http://code.google.com/p/sympy/wiki/DownloadInstallation?tm=2" title="http://code.google.com/p/sympy/wiki/DownloadInstallation?tm=2">Downloads</a>
    section on the
    <span class="application">SymPy</span>'s webpage.
</p>
</div>
<div class="division sect2">
<div class="header"><h2 class="sect2 title"><span class="title"><span class="label">1.3. </span><span class="command">isympy</span> Console</span></h2></div>
<p class="para block block-first">
          For
          experimenting with new features, or when figuring out how to do
          things, you can use our special wrapper around IPython:
          <div class=" block screen block-indent block-first"><pre class="screen"><span class="prompt">$</span> <span class="userinput">cd sympy-0.5.12</span>
<span class="prompt">$</span> <span class="userinput">bin/isympy</span>
Python 2.4.4 console for SymPy 0.5.12-hg. These commands were executed:
&gt;&gt;&gt; from __future__ import division
&gt;&gt;&gt; from sympy import *
&gt;&gt;&gt; x, y, z = symbols('xyz')
&gt;&gt;&gt; k, m, n = symbols('kmn', integer=True)
&gt;&gt;&gt; f = Function("f")

Documentation can be found at http://sympy.org/


In [1]: <span class="userinput">(1/cos(x)).series(x, 0, 10)</span>
Out[1]: 
     2      4       6        8           
    x    5*x    61*x    277*x            
1 + ── + ──── + ───── + ────── + O(x**10)
    2     24     720     8064            </pre></div>
      </p>
<div class="admonition block note block-indent">
        <p class="para block block-first">Commands entered by you are bold. Thus what we did in 3 lines in
            a regular Python interpeter can be done in 1 line in
            <span class="command">isympy</span>.
        </p>
    </div>
</div>
</div></div>
<div class="navbar navbar-bottom"><table class="navbar"><tr>
<td class="navbar-prev"><a class="navbar-prev" href="getting-started.html" title="Getting Started">Getting Started</a></td>
<td class="navbar-next"><a class="navbar-next" href="learning-sympy.html" title="Learning SymPy">Learning SymPy</a></td>
</tr></table></div>
</body>
</html>
